package com.nf;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Test2 {

    public static void main(String args[]) {
        ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");
        男同学 n1 = (男同学)ac.getBean("n1");

        男同学 n2 = (男同学)ac.getBean("n1");
        //男同学 n3 = new 男同学();

        System.out.println(  n1.getAge() );
        n1.setAge(39);
        System.out.println(  n1.getAge() );

        System.out.println(  n2.getAge() );

        System.out.println( n1 );
        System.out.println( n2 );
        //System.out.println( n3 );


        //System.out.println( n1.get老婆()  );
        //System.out.println( n2.get老婆()  );



//        System.out.println(  n1.getName() );
//        System.out.println(  n1.getAge() );
//        System.out.println(  n1.get老婆() );
    }
}
